/**
 */
package mymobile.mobileTest.impl;

import mymobile.mobileTest.AppMobile;
import mymobile.mobileTest.MobileTestPackage;
import mymobile.mobileTest.Setting;
import mymobile.mobileTest.View;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>App Mobile</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link mymobile.mobileTest.impl.AppMobileImpl#getAppName <em>App Name</em>}</li>
 *   <li>{@link mymobile.mobileTest.impl.AppMobileImpl#getTarget <em>Target</em>}</li>
 *   <li>{@link mymobile.mobileTest.impl.AppMobileImpl#getMainView <em>Main View</em>}</li>
 *   <li>{@link mymobile.mobileTest.impl.AppMobileImpl#getAppSetting <em>App Setting</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class AppMobileImpl extends EObjectImpl implements AppMobile {
	/**
	 * The default value of the '{@link #getAppName() <em>App Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAppName()
	 * @generated
	 * @ordered
	 */
	protected static final String APP_NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getAppName() <em>App Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAppName()
	 * @generated
	 * @ordered
	 */
	protected String appName = APP_NAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getTarget() <em>Target</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTarget()
	 * @generated
	 * @ordered
	 */
	protected static final String TARGET_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getTarget() <em>Target</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTarget()
	 * @generated
	 * @ordered
	 */
	protected String target = TARGET_EDEFAULT;

	/**
	 * The cached value of the '{@link #getMainView() <em>Main View</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMainView()
	 * @generated
	 * @ordered
	 */
	protected View mainView;

	/**
	 * The cached value of the '{@link #getAppSetting() <em>App Setting</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAppSetting()
	 * @generated
	 * @ordered
	 */
	protected Setting appSetting;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected AppMobileImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return MobileTestPackage.Literals.APP_MOBILE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getAppName() {
		return appName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAppName(String newAppName) {
		String oldAppName = appName;
		appName = newAppName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobileTestPackage.APP_MOBILE__APP_NAME, oldAppName, appName));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getTarget() {
		return target;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTarget(String newTarget) {
		String oldTarget = target;
		target = newTarget;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobileTestPackage.APP_MOBILE__TARGET, oldTarget, target));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public View getMainView() {
		if (mainView != null && mainView.eIsProxy()) {
			InternalEObject oldMainView = (InternalEObject)mainView;
			mainView = (View)eResolveProxy(oldMainView);
			if (mainView != oldMainView) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MobileTestPackage.APP_MOBILE__MAIN_VIEW, oldMainView, mainView));
			}
		}
		return mainView;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public View basicGetMainView() {
		return mainView;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMainView(View newMainView) {
		View oldMainView = mainView;
		mainView = newMainView;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobileTestPackage.APP_MOBILE__MAIN_VIEW, oldMainView, mainView));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Setting getAppSetting() {
		if (appSetting != null && appSetting.eIsProxy()) {
			InternalEObject oldAppSetting = (InternalEObject)appSetting;
			appSetting = (Setting)eResolveProxy(oldAppSetting);
			if (appSetting != oldAppSetting) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MobileTestPackage.APP_MOBILE__APP_SETTING, oldAppSetting, appSetting));
			}
		}
		return appSetting;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Setting basicGetAppSetting() {
		return appSetting;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAppSetting(Setting newAppSetting) {
		Setting oldAppSetting = appSetting;
		appSetting = newAppSetting;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobileTestPackage.APP_MOBILE__APP_SETTING, oldAppSetting, appSetting));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case MobileTestPackage.APP_MOBILE__APP_NAME:
				return getAppName();
			case MobileTestPackage.APP_MOBILE__TARGET:
				return getTarget();
			case MobileTestPackage.APP_MOBILE__MAIN_VIEW:
				if (resolve) return getMainView();
				return basicGetMainView();
			case MobileTestPackage.APP_MOBILE__APP_SETTING:
				if (resolve) return getAppSetting();
				return basicGetAppSetting();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case MobileTestPackage.APP_MOBILE__APP_NAME:
				setAppName((String)newValue);
				return;
			case MobileTestPackage.APP_MOBILE__TARGET:
				setTarget((String)newValue);
				return;
			case MobileTestPackage.APP_MOBILE__MAIN_VIEW:
				setMainView((View)newValue);
				return;
			case MobileTestPackage.APP_MOBILE__APP_SETTING:
				setAppSetting((Setting)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case MobileTestPackage.APP_MOBILE__APP_NAME:
				setAppName(APP_NAME_EDEFAULT);
				return;
			case MobileTestPackage.APP_MOBILE__TARGET:
				setTarget(TARGET_EDEFAULT);
				return;
			case MobileTestPackage.APP_MOBILE__MAIN_VIEW:
				setMainView((View)null);
				return;
			case MobileTestPackage.APP_MOBILE__APP_SETTING:
				setAppSetting((Setting)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case MobileTestPackage.APP_MOBILE__APP_NAME:
				return APP_NAME_EDEFAULT == null ? appName != null : !APP_NAME_EDEFAULT.equals(appName);
			case MobileTestPackage.APP_MOBILE__TARGET:
				return TARGET_EDEFAULT == null ? target != null : !TARGET_EDEFAULT.equals(target);
			case MobileTestPackage.APP_MOBILE__MAIN_VIEW:
				return mainView != null;
			case MobileTestPackage.APP_MOBILE__APP_SETTING:
				return appSetting != null;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (appName: ");
		result.append(appName);
		result.append(", target: ");
		result.append(target);
		result.append(')');
		return result.toString();
	}

} //AppMobileImpl
